// import Cookies from 'js-cookie'
import { rsaDecrypt, rsaEncrypt } from '@/utils/commonutils3';

const TokenKey = 'storeEchartsToken';
const SId = 'storeEchartsSid';

export function getToken() {
	return rsaDecrypt(localStorage.getItem(TokenKey));
	// return Cookies.get(TokenKey)
}

export function setToken(token) {
	return localStorage.setItem(TokenKey, rsaEncrypt(token));
	// return Cookies.set(TokenKey, token)
}

export function removeToken() {
	// return Cookies.remove(TokenKey)
	return localStorage.removeItem(TokenKey);
}

export function getSid() {
	// return Cookies.get(SId)
	return rsaDecrypt(localStorage.getItem(SId));
}

export function setSid(sid) {
	// return Cookies.set(SId, sid)
	return localStorage.setItem(SId, rsaEncrypt(sid));
}

export function removeSid(sid) {
	// return Cookies.set(SId, sid)
	return localStorage.removeItem(SId);
}
